<template>
	<view class="page">
		<view class="">哈老师</view>
		<view>
			<view>权限</view>
			<ch :value="roletabs" :current="roletabindex"></radiobutton>

			<view>权限设置</view>
			<view v-for="(item,index) in  roleList" :key="index">
				<tag :value="item">
				</tag>
			</view>

		</view>

	</view>
</template>

<script>
	import pageHead from '../../../components/page-head.vue'
	import tag from '../../../components/tag.vue'
	import changebar from '../../../components/changebar.vue'
	import {
		mapActions,
		mapGetters,
		mapState
	} from 'vuex'

	export default {
		watch: {
			roletabindex: function(val, oldval) {
				if (val !== oldval)
					if (val == 0)
						roleList = rolemap['jw'];
					else {
						roleList = rolemap['ls'];
					}

			}
		},
		computed: {
			...mapGetters['', '']
		},
		components: {
			tag,
			changebar,

		},
		data() {
			return {
				rolemap: {
					'jw': [{
						roleid: 1,
						name: '学员'
					}],
					'ls': [{
						roleid: 1,
						name: '学员'
					}]
				},
				roleList: null,
				roletabindex: 0,
				roletabs: ['老师', '教务'],
				eid: null,
				empinfo: null,
			}

		},
		onLoad:function(option){
			this.initData();

		}






		methods: {
			async initData() {
				const res = await empdetail({
					"id": this.eid
				});
				if (res.success == true) {
					empinfo = res.data.values;
				} else {

				}
			},
			async updateemp() {
				const res = await updateemp(empinfo);
				if (res.success == true) {
					uni.navigateBack({
						delta: 1
					})
				} else {

				}


			}




		}




	}
</script>

<style scoped >
	@import "../../../common/uni.css";
</style>
